package com.itheima;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import redis.clients.jedis.Jedis;

@SpringBootApplication
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
public class UseStarterApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(UseStarterApplication.class, args);
        Object jedis = context.getBean("jedis");
        System.out.println(jedis);
    }

    /*@Bean
    public Jedis jedis() {
        String host = "localhost";
        Integer port = 4399;
        System.out.println("目前的host为:" + host + ",端口号为:" + port);
        return new Jedis(host, port);
    }*/
}
